<html>
<#include "../common/header.ftl">

<body>
<div id="wrapper" class="toggled">

    <#--边栏sidebar-->
    <#if  code ==1>
        <#include "../common/nav.ftl">
        <#else >
            <#include "../common/nav3.ftl">
    </#if>


    <#--主要内容content-->
    <div id="page-content-wrapper">
        <div class="container-fluid">
            <div class="row clearfix">
                <div class="col-md-12 column">
                    <table class="table table-bordered table-condensed">
                        <thead>
                        <tr>
                            <th>商品id</th>
                            <th>商品名称</th>
                            <th>小图</th>
                            <th>单价</th>
                            <th>库存</th>
                            <th>描述</th>
                            <#if  code ==1>
                            <th >操作</th>
                            </#if>
                        </tr>
                        </thead>
                        <tbody>

                        <#list productPageInfo.list as product>
                            <tr>
                                <td>${product.productId}</td>
                                <td>${product.productName}</td>
                                <td><img height="100" width="120" src="${product.productIcon}" alt=""></td>
                                <td>${product.productPrice}</td>
                                <td>${product.productStock}</td>
                                <td>${product.productDescription}</td>
                                <#if  code ==1>
                                <td><a href="/sell/seller/product/index?productId=${product.productId}">修改</a></td>
                                </#if>
                            </tr>
                        </#list>
                        </tbody>
                    </table>
                </div>

                <#--分页-->
                <div class="col-md-12 column " >
                    <ul class="pagination pull-right ">
                        <#if currentPage lte 1>
                            <li class="disabled"><a href="#">上一页</a></li>
                        <#else>
                            <li><a href="/sell/seller/product/list?page=${currentPage - 1}&size=${size}&code=${code}">上一页</a></li>
                        </#if>

                        <#list 1..totalpage as index>
                            <#if currentPage == index>
                                <li class="disabled"><a href="#">${index}</a></li>
                            <#else>
                                <li><a href="/sell/seller/product/list?page=${index}&size=${size}&code=${code}">${index}</a></li>
                            </#if>
                        </#list>

                        <#if currentPage gte totalpage>
                            <li class="disabled"><a href="#">下一页</a></li>
                        <#else>
                            <li><a href="/sell/seller/product/list?page=${currentPage + 1}&size=${size}&code=${code}">下一页</a></li>
                        </#if>
                    </ul>
                </div>
            </div>
        </div>
    </div>

</div>
</body>
</html>